{{define "cms/login.html"}}
{{ template "header" . }}

<body class="gray-bg">

    <div class="middle-box text-center loginscreen">
        <div>
            <div>

                <h1 class="logo-name">H+</h1>

            </div>
            <h3>欢迎使用</h3>

            <form class="m-t" action="/login" method="post" target="_self">
                <div class="form-group">
                    <input type="text" name="name" class="form-control" placeholder="用户名" required>
                </div>
                <div class="form-group">
                    <input type="password" name="passwd" class="form-control" placeholder="密码" required>
                </div>
                <div class="form-group">
                    <input type="text" name="captcha" class="form-control" style="width: 138px;    ;height:40px;display: inline-block;float: left" placeholder="验证码" required>
                    <img src="" onclick="resetCaptcha()" class="captcha-img" alt="点击刷新验证码">
                </div>
                <button type="submit" class="btn btn-primary block full-width m-b">登 录</button>

            </form>
        </div>
    </div>
</body>

{{ template "footer" . }}

<script>
    if (window.top !== window.self) {
        window.top.location = window.location;
    }
    $(function () {
        $.get("/captcha",function (res) {
            $(".captcha-img").attr("src", res);
        })
    });
    function resetCaptcha() {
        $.get("/captcha",function (res) {
            $(".captcha-img").attr("src", res);
        })
    }
</script>

{{end}}